home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
526-550
/
disk_533
/
vtest
/
vtest.doc
< prev
next >
Wrap
Text File
|
1992-05-06
|
9KB
|
231 lines
#--------------------------------------------------------------------------
VTest.doc 10.08.91
VTest.doc
by
Frank Enderle
Emmendingen / GERMANY
VERSION 1.0 COPYRIGHT 1991 BY F.ENDERLE
#--------------------------------------------------------------------------
***************************************************************************
I M P O R T A N T
--------------------------
You can feel free to use this routine in your own programs. Feel also free
to modify the routine. Use it as an example how to test the vectors. If
you use this routine iin your own program please remark my name.
***************************************************************************
Starting:
To Test the routine please load a resident program (Guardian , Whiskey)
and start the program example.
NOTE: Compilation
Compile with Aztec 3.6a:
CC VTest.c +l -s
CC Example.c +l -s
LN Example VTest -lc32
Program description:
FUNCTION DESCRIBTION
CheckVecs() (NO PARAMETER)
This function checks if the vectors are all set to de-
fault. If not it will jump to Fuction Virus().
If you don't copy SysBase into ExecBase, ExecBase will
point to Adress 0. The result will be wrong results.
ColdCapture (Offset 42 / $2A) :
ColdCapture is not so often used. It is very uncom-
fortable. The stack is not correctly initialized
so you can't use the stack for your program. The
return address is saved in a5. The default is
$00000000.
CoolCapture (Offset 46 / $2E) :
This vector could point to a routine which will be
called by a reset. The difference to ColdCapture:
CoolCapture is raised later than ColdCapture.
The default is $00000000.
WarmCapture (Offset 50 / $32) :
WarmCapture is only used if the DOS couldn't be
initialized. So it is of no use for normal program-
ing. The default is $00000000.
KickMemPtr (Offset 546 / $222) :
This points to a MemList structure. After a reset
the memory of this structure is allocated again.
KickTagPtr (Offset 550 / $226) :
Pointer to a Resident Table. This Table will be
inserted to the Resident Table of Exec. (So it
will be executed by the next reset).
GetDoIO() (internal function) :
This function returns the address where the offset of
DoIO() points to. If the address is less as $F00000
it points to ram. DoIO() is often altered by a virus.
GetSendIO() (internal function):
Returns the address where SendIO() points to. See
GetDoIO().
GetSumKick() (internal function):
Returns the address where SendIO() points to. This
vector is used by some Viruscheckers like e.g.
Whiskey.
After testing all this Vectors CheckVecs() returns
whether the returnvalue of Virus() or NULL.
---------------------------------------------------------------------------
Virus() (NO PARAMETER)
The main routine: Window handling, Gadget handling
First of all open all needed stuff. (OpenAll())
Draw boxes and texts in window. (SetUpWindow())
Print the Vectors. (SetUpData())
Now wait for the Message (Wait())
Classify Message. If GADGETUP classify Gadget ID.
CLRVECS:
Clear all Vectors and calc the new CheckSum.
HARDRESET:
Do a really hard reset by destroying ChkBase (Offset
38). The computer thinks that something goes wrong,
and by the next Reset the ExecBase will be fully
reorganized. All resident programms will be destro-
yed. (ColdReset())
I think the Hardreset would not work under KICK 2.0.
QUIT:
Close all the stuff before was opened. (CloseAll())
default:
An illegal message by Gadgetup returns ILLEGALMSG.
---------------------------------------------------------------------------
SetUpData() (NO PARAMETER)
Print all Vectors in the Window.
---------------------------------------------------------------------------
CheckDoIO() (NO PARAMETER)
Checks if DoIO() points to ram or rom. In case pointing
to ram CheckDoIO() prints *** ALTERED *** in window el-
se it prints unset in the window. Also it prints the
Address DoIO() points to.
---------------------------------------------------------------------------
CheckSendIO() (NO PARAMETER)
See CheckDoIO().
---------------------------------------------------------------------------
CheckSumKick() (NO PARAMETER)
See CheckDoIO().
---------------------------------------------------------------------------
Check(Vec, Line) (Vec = Pointer to Vector, Line = X offset of printout)
ULONG Vec; Prints out the vector at an specified X Offset. Y Off-
SHORT Line; set is always the same. See also CheckDoIO();
---------------------------------------------------------------------------
SetUpWindow() (NO PARAMETER)
This function prints only texts and Boxes in the
window. It simply sets up the Graphic.
---------------------------------------------------------------------------
OpenAll() (NO PARAMETER)
Opens Intuition, Graphics, the Window, topaz 80 and
sets up the font in the window. (So always topaz 80
is used)
---------------------------------------------------------------------------
CloseAll() (NO PARAMTER)
Closes all the things we opened before in OpenAll()
---------------------------------------------------------------------------
Box(Win,x1,y1,x2,y2) Win = Pointer to Window structure
struct Window *Win; x1,x2 = Offset for left, top edge
SHORT x1,x2,y1,y2; x2,y2 = Offset for right, bottom edge
The function draws a box with shadow in the RastPort
of the window Win.
---------------------------------------------------------------------------
Print(Win,msg,x,y,c) Win = Pointer to Window structure
struct Window *Win; msg = Pointer to string
STRPTR msg; x,y = Offset in the window
SHORT x,y; c = Centering (0 = OFF / 1 = ON)
BOOL c;
The function prints a Text (msg) into the RastPort of
the Window (Win). x and y specify the left, top edge
of the first character. c decides between centering
on or off.
---------------------------------------------------------------------------
GetDoIO() (NO PARAMETER)
movem.l a1-a6,-(a7) copy the register we use to stack
move.l _SysBase,a6
lea _LVODoIO(a6),a1 get offset of DoIO()
lea 2(a1),a2 get the address (I want not the
opcode for jmp)
move.l (a2),d0 copy address to d0
move.l (a7)+,a1-a6 restore registers
rts jump back
---------------------------------------------------------------------------
GetSendIO() (NO PARAMETER)
See GetDoIO()
---------------------------------------------------------------------------
GetSumKick() (NO PARAMETER)
See GetDoIO()
---------------------------------------------------------------------------
CheckSum() (NO PARAMETER)
Calc new checksum
---------------------------------------------------------------------------
ColdReset() (NO PARAMETER)
Do a Hard Reset
---------------------------------------------------------------------------
I could not guarantee for the correctness of this description.
AMIGA MAKES ALL POSSIBLE
Have fun
-Frank